<ion-header>
    <ion-navbar no-border-bottom>
        <ion-title >数据过滤</ion-title>
      <ion-buttons>
        <button ion-button (click)="cancel()" >关闭</button>
      </ion-buttons>
    </ion-navbar>
</ion-header>
<ion-content class='email-list'>
  <ion-list class='gfoa-list'>
    <ion-item *ngIf="!condition.showByMaturityDate">
      <ion-label>试算日期:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" [(ngModel)]="condition.l_begin_date"
                    cancelText="取消" doneText="确定">
      </ion-datetime>
    </ion-item>
    <ion-item *ngIf="!condition.showByMaturityDate">
      <ion-label>是否根据到日期筛选</ion-label>
      <ion-toggle [(ngModel)]="condition.isSearchByDate"></ion-toggle>
    </ion-item>
    <ion-item>
      <ion-label>到期日始:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" [(ngModel)]="condition.startDate"
                    cancelText="取消" doneText="确定" max="{{maxDate}}" [disabled]="!condition.showByMaturityDate && !condition.isSearchByDate">
      </ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>到期日止:</ion-label>
      <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY-MM-DD" [(ngModel)]="condition.endDate"
                    cancelText="取消" doneText="确定" min="{{minEndDate}}" max="{{maxDate}}" [disabled]="!condition.showByMaturityDate && !condition.isSearchByDate">
      </ion-datetime>
    </ion-item>
  </ion-list>
  <ion-row >
    <ion-col text-center>
      <button block ion-button color="light" (click)="search()">确定</button>
    </ion-col>
  </ion-row>
</ion-content>
